package utils;


import java.security.SecureRandom;

public class IdGenerator {
    private static IdGenerator guidgen;
    private SecureRandom random;

    private IdGenerator() {
        this.random = new SecureRandom();
    }

    public static synchronized IdGenerator getInstance() {
        if (guidgen == null) {
            guidgen = new IdGenerator();
        }
        return guidgen;
    }

    public String getKey() {
        String key = "" + System.currentTimeMillis() + Long.toHexString(random.nextInt());
        return key;
    }
}